UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6f6OWwm4VKHoQcmdHrrAONTfh+Uavft9LQnWxhrgm3E='
WHERE
key_id = 'ebb977c53fef10e6cb4be101edc59a8cb82897ec4f8e90e577fd7438dc80fb9a'
AND (
token = '6f6OWwm4VKHoQcmdHrrAONTfh+Uavft9LQnWxhrgm3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)