UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mvQofMpBHATe7RmX/TKjXTgFqQeykNRFWDeOrMtp0XY='
WHERE
key_id = '94fda11d6c8d1ac5e34a3082a85d246d4567124f979984642b0e77c0b6339c60'
AND (
token = 'mvQofMpBHATe7RmX/TKjXTgFqQeykNRFWDeOrMtp0XY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)