UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WzKWL1tVzM51gnNettu3LtNtnkLAxCbsskm9rfJwOLc='
WHERE
key_id = 'cad2ce19a851cf6e20ba8b955c63128454ba66ac675e37959541b75df02f845b'
AND (
token = 'WzKWL1tVzM51gnNettu3LtNtnkLAxCbsskm9rfJwOLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)