UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7B+Itebf/uQy6aSjKDhXNY2225bbajoN6AHHjZ+rM/M=' 
WHERE 
  key_id = 'd0f8236461dc411c2e36680bca921729a6a18474d34806f25b609f6f34e1cfe6' 
  AND (
    token = '7B+Itebf/uQy6aSjKDhXNY2225bbajoN6AHHjZ+rM/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043