UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1K1/QiSfrO/jKGo1v4Vh4FzMvHMS+RSebYl2P9Hj6Z4='
WHERE
key_id = '1253d3059dd687a13616e14d5d755dfc183aeb0c3fd68ae88f6ffe8f42e54994'
AND (
token = '1K1/QiSfrO/jKGo1v4Vh4FzMvHMS+RSebYl2P9Hj6Z4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)