UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Szv/pIouya9N8F6Z8Qb/nw6DYSi6KYA1//jYAU8vqRI='
WHERE
key_id = 'b3c96731fc11dfbb286b9377701913390acf2a5348d98adc7f2aedae25fbff02'
AND (
token = 'Szv/pIouya9N8F6Z8Qb/nw6DYSi6KYA1//jYAU8vqRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)