UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ORZ0ukPE0pozyAjOy83XLq+iOWKA38pjBI7SupvkfO0='
WHERE
key_id = 'c7b74ef87f7351da6a97b0f65af0b3982374f2d8bd4e87fd6b511b2560368862'
AND (
token = 'ORZ0ukPE0pozyAjOy83XLq+iOWKA38pjBI7SupvkfO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)