UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1kMHZnBWBJMycel030meJCfMFSj4uPOE3LUPvotRNlM='
WHERE
key_id = 'c9a6e18ded89db7a0b0226fcae23768e1c37941f3bd04f9fef2082dc5fb21960'
AND (
token = '1kMHZnBWBJMycel030meJCfMFSj4uPOE3LUPvotRNlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)