UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7d55XHMkVyv8GRhnKCnnN83nMh/AFcw5Fnxg5g6Ri44='
WHERE
key_id = '5f40936ca232050f58dc836c4405ee00283448036bfa3fed9af02ff452cf1533'
AND (
token = '7d55XHMkVyv8GRhnKCnnN83nMh/AFcw5Fnxg5g6Ri44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)