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