UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OWXtnhNGAfHtJ/AHWGy0lfSAtDbGK67n9u5I3ZuK6BY='
WHERE
key_id = '51705112951849468001f3899462217279ab763f9798e3d1bea2c844ab452bb9'
AND (
token = 'OWXtnhNGAfHtJ/AHWGy0lfSAtDbGK67n9u5I3ZuK6BY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)