UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DeZ5SnNqJPsUAiV/sC89is2KLsd2R3zI0QD15CD8RGQ='
WHERE
key_id = 'f93a8c3f4acfc3362afb87c5e94155734ddff116b62c979ede1d8b6327348e98'
AND (
token = 'DeZ5SnNqJPsUAiV/sC89is2KLsd2R3zI0QD15CD8RGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)