UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Js6sqcZgh+M/qua9192MPznhVjGNPHyHkEhb8CeJaOk='
WHERE
key_id = '20d268aa796691adb08dd5c2e7ffeb975744b6889664c6bc180e3eabe66c2aea'
AND (
token = 'Js6sqcZgh+M/qua9192MPznhVjGNPHyHkEhb8CeJaOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)