UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wbpOHPck6olkW16eOBUarSldxTHYpRZjqtqEd8jmIV0=' 
WHERE 
  key_id = '05b389d02cbeee7c65154e3e25c92e16b7d94c79ae2185a564877e429fbdf49c' 
  AND (
    token = 'wbpOHPck6olkW16eOBUarSldxTHYpRZjqtqEd8jmIV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042