UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JxTSswRRB6n5ISh8qINiiZkNoHoqh9SqfB9MSmLgBlk='
WHERE
key_id = '227042f7e11c966a71861e5a84f2a8154cb989925416fa6d44a4e74ffa26629d'
AND (
token = 'JxTSswRRB6n5ISh8qINiiZkNoHoqh9SqfB9MSmLgBlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)