UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r94NhcwAobkL1SkiuQ1CUkG3/4a/aJR5/c9JWFemIqY='
WHERE
key_id = '5df4fe97cc8210c6d2fa8057dfed6bf82cb4cfe2b2c2ee4c722ef168fd0ed9c1'
AND (
token = 'r94NhcwAobkL1SkiuQ1CUkG3/4a/aJR5/c9JWFemIqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)