UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vix9lE8gdti0tJdJAUYdRwzBfpCFEL3RohOa/5elw9E='
WHERE
key_id = 'ab7a4ed9b37fd78291708bb7192f73255307129281c4253b26ee0b04e2c78b67'
AND (
token = 'Vix9lE8gdti0tJdJAUYdRwzBfpCFEL3RohOa/5elw9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)