UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2FJHT4K9V2EYZfhJFhkTXcdpd63n+GGCWuwDVSCnaug='
WHERE
key_id = '08e95e6421f4040508b9a7cdd396ea76a685a8dd2f055669ae347592dd8fc0b2'
AND (
token = '2FJHT4K9V2EYZfhJFhkTXcdpd63n+GGCWuwDVSCnaug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)