UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0UZ89xJIFkkj5a/AJhrRWGY6jbmm+t+cuL0nAWakiKs='
WHERE
key_id = '1e4ec4d15d350cf9919782ec597a6088f6806ca9d29c5e1559546a54a1332e55'
AND (
token = '0UZ89xJIFkkj5a/AJhrRWGY6jbmm+t+cuL0nAWakiKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)