UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gSNxPCAtRErHnyHKkckTWtUpsdl6ewyuZzAnF4oo09A='
WHERE
key_id = '7bdefa608229881ebde4ddcc7a66eed06166399a7c5ec33b1cdaa82baa3716db'
AND (
token = 'gSNxPCAtRErHnyHKkckTWtUpsdl6ewyuZzAnF4oo09A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)