UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+iYLbuGzURF+ZemrZ7aPmmFgudwzjrBIe/38I6aggOQ='
WHERE
key_id = 'bf2562cb6fe0cfb3d569ba590779fbeaba7e9f9d441a2b50f0c57d1d49831288'
AND (
token = '+iYLbuGzURF+ZemrZ7aPmmFgudwzjrBIe/38I6aggOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)