UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qHBVpUhEyOuvObPf6J0UGQzS2OpMInHwf8bmtTD7oAg=' 
WHERE 
  key_id = '8ecca2b8d78c46382b723ec4f19afae0439216b9b27e92b4cfaf25aabe6a5568' 
  AND (
    token = 'qHBVpUhEyOuvObPf6J0UGQzS2OpMInHwf8bmtTD7oAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022