UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hfnXYGAb6DwlNKeukl+LFS1rOHE99Aw5H05RLHO9JEk='
WHERE
key_id = 'f81e8bf4c4e09b2b98f3414a080e948952e84426efa40d83a419a32c7ef69d44'
AND (
token = 'hfnXYGAb6DwlNKeukl+LFS1rOHE99Aw5H05RLHO9JEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)