UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/cCCKUS4fXzrUodWeVtrw/BVSR1+xyZfBBU+LP64WeA='
WHERE
key_id = 'a6a18a2c0c6e2d4f00cfb7aa8f88b018ac8ab7220f511ef19e91195e4262c24e'
AND (
token = '/cCCKUS4fXzrUodWeVtrw/BVSR1+xyZfBBU+LP64WeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)