UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GhcI0kQd12QRqL8hLCNr9h053JUZ/2r9usRejoLjEjw=' 
WHERE 
  key_id = '2355a978d0e738ba6d448f13cc4a55dd68794101a066835b2f962c2812cde5eb' 
  AND (
    token = 'GhcI0kQd12QRqL8hLCNr9h053JUZ/2r9usRejoLjEjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042