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