UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9tCs794TFFY4GgCitih/0W2NQ1ZgQzA1o9s2UuSjTNE=' 
WHERE 
  key_id = '8666a2cc202868e9f2508f5d0732ab57d03545befac9c1678ab937e7e9c762cb' 
  AND (
    token = '9tCs794TFFY4GgCitih/0W2NQ1ZgQzA1o9s2UuSjTNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054