UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F8DNcjyGa1pNIXI0n9pBsMqtm97lx0w4to+JFGxqjSk=' 
WHERE 
  key_id = 'c164183cab7083cb2e030bc0f64310a066bc0f4f82cd1380693caeffcbf09fcc' 
  AND (
    token = 'F8DNcjyGa1pNIXI0n9pBsMqtm97lx0w4to+JFGxqjSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027