UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1gqn5VR4WyjvOtNZJdn29EYumLWsbEGG8FwPrhTWtYY='
WHERE
key_id = 'e23d7b4b1a77b47fd45e3ffecf49a8d6fe560f75fddcc55a7ced8a4b2b089a89'
AND (
token = '1gqn5VR4WyjvOtNZJdn29EYumLWsbEGG8FwPrhTWtYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)